package com.atguigu.proxy.dynamic;

/**
 * @Description: JDK动态代理
 * @Author lixiaolong
 * @Date 2023/9/28
 */
public class Client {

	public static void main(String[] args) {
		// 目标对象
		ITeacherDao target = new TeacherDao();

		// 代理对象
		ITeacherDao proxyInstance = (ITeacherDao) new ProxyFactory(target).getProxyInstance();

		// proxyInstance=class com.sun.proxy.$Proxy0 �ڴ��ж�̬�����˴������
		System.out.println("proxyInstance=" + proxyInstance.getClass());

		// 调用代理对象的方法
		proxyInstance.sayHello(" tom ");
	}

}
